package cn.ds.fly.modules.sys.entity;

import cn.ds.fly.common.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

/**
 * Created by lds on 2017/12/14.
 */
@Data
@Table(name = "fly_menu")
@NoArgsConstructor
@AllArgsConstructor
public class FlyMenu extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 609808051570925911L;


    /**
     * 父菜单ID，一级菜单为0
     */
    @Column(name = "parent_id")
    private String parentId;

    /**
     * 父菜单名称
     */
    @Transient
    private String parentName;

    /**
     * 菜单名称
     */
    private String name;

    /**
     * 菜单URL
     */
    private String url;

    /**
     * 授权(多个用逗号分隔，如：user:list,user:create)
     */
    private String perms;

    /**
     * 类型     0：目录   1：菜单   2：按钮
     */
    private Integer type;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 排序
     */
    @Column(name = "order_num")
    private Integer orderNum;

    /**
     * ztree属性
     */
    @Transient
    private Boolean open;

    /**
     * 子菜单
     */
    @Transient
    private List<?> list;


}
